//
//  RTJBidRecordsCell.m
//  RuiTaiJinProject
//
//  Created by jayson on 2018/12/10.
//  Copyright © 2018年 leewei. All rights reserved.
//

#import "RTJBidRecordsCell.h"

@implementation RTJBidRecordsCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    [self backview:_bg_view viewOfcornerRadius:5];
    [self backview:_bg_view2 viewOfcornerRadius:5];
    [self backview:_bg_view5 viewOfcornerRadius:5];
    [self backview:_bg_view6 viewOfcornerRadius:5];
    [self backview:_bg_view7 viewOfcornerRadius:5];

    NSString *str = @"1、本活动中的【感恩回馈，上线有礼003】为虚拟产品。预期年化收益率为8%，出借期限为1天 ；\n2、投资成功后，第二天到当前页面领取收益；\n3、募集期结束后进入运行期。本体验产品不支持现金充值购买；\n4、投资当天开始计算收益，该产品的出借期限届满后结算收益；\n5、活动中获取的收益可用以项目投资。";
    
    _touziContent.attributedText = [self getAttributedStringWithString:str lineSpace:15];

    
}

-(NSAttributedString *)getAttributedStringWithString:(NSString *)string lineSpace:(CGFloat)lineSpace {
    
    NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:string];
    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    paragraphStyle.lineSpacing = lineSpace; // 调整行间距
    NSRange range = NSMakeRange(0, [string length]);
    [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:range];
    return attributedString;
}

-(void)backview:(UIView *)backview viewOfcornerRadius:(NSInteger)cornerRadius{
    
    backview.layer.cornerRadius = cornerRadius;
    backview.layer.shadowColor = [UIColor colorForHex:@"#dbc9cc"].CGColor;
    backview.layer.shadowOffset = CGSizeMake(-1, 1);
    backview.layer.shadowOpacity = 0.5;
    backview.layer.shadowRadius = 5;
    
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
